home *** CD-ROM | disk | FTP | other *** search
- _
- _ Copyright (c) 1986, 1990 by The Trustees of Columbia University in
- _ the City of New York. Permission is granted to any individual or
- _ institution to use, copy, or redistribute this software so long as it
- _ is not sold for profit, provided this copyright notice is retained.
- _
- _ Author: Andrew Lowry
-
- /* switch parsing errors */
-
- fnerror(NM,`Does not match switch')
- fnerror(AMB,`Ambiguous')
- fnerror(ABR,`Invalid abbreviation chain in switch table')
- fnerror(BEG,`Switch does not begin with required punctuation')
- fnerror(END,`Final switch punctuation not allowed on selected switch')
-
- /*
- * SWTCH structure specifies one entry in a switch table. SWITAB
- * structure describes a table of switches. (We use the name
- * swtch instead of switch because the latter is a C reserved word.)
- */
-
- typedef struct SWTCH {
- char * _swswi; /* switch string (without punctuation) */
- short _swflg; /* flags (see below) */
- int _swval; /* arbitrary value, not used internally */
- /* except for abbreviations... see SWI_ABR */
- /* flag below */
- } swtch;
-
- typedef struct SWITAB {
- int _stcnt; /* number of switches in table */
- swtch * _stwds; /* array of switch entries */
- } switab;
-
- /* Flags that can be present in a switch entry */
-
- fnflag(ABR) /* switch is an abbreviation for the */
- /* switch indexed by this entry's _swval */
- /* value */
- fnflag(NOR) /* Ignore this switch (do not recognize */
- /* any prefix, or even an exact match) */
- fnflag(INV) /* Invisible switch (not shown with help) */
- fnflag(MAT) /* This switch matches current input (used */
- /* internally) */
-